#!/user/bin/env node

const fs = require('fs'),
      sfile = process.argv[2],
      dfile = process.argv[3];

fs.readFile(sfile,(err)=>{
  if(err){
  console.error(err.message);
  process.exit(1);
}else{
  let stm = fs.createReadStream(sfile).pipe(fs.createWriteStream(dfile));

  stm.on('close',()=>{
  fs.chmodSync(dfile,fs.statSync(sfile).mode);
  })
}
})
